<?php
session_start();
include_once 'mysql.php';
include_once 'globals.php';

$persistant_login = isset($_POST['persistant_login']) ? $_POST['persistant_login'] : "";
$email = isset($_POST['email']) ? $_POST['email'] : "null";
$password = isset($_POST['password']) ? $_POST['password'] : "null";

$password = md5($password);

$login_query = "SELECT id FROM users WHERE email = '$email' and password = '$password'";

$result = mysql_query($login_query) or die(mysql_error());
$login_info = mysql_fetch_assoc($result);

if($login_info == true) {
    $_SESSION['youdo_userid'] = $login_info['id'];
	header("Location: ../application.php");
}
?>

